package Test;
import MyLinkedList.MyLinkedList;

public class TestMyLinkedList extends Test{
    public void test() {
        MyLinkedList<Integer> list1 = new MyLinkedList<Integer>();
        for(int i = 0; i < 5; i++) {
            list1.addLast(i);
        }
        System.out.println(list1);
        System.out.println(list1.size());
        list1.clear();
        System.out.println("list1: " + list1);
        for(int i = 0; i < 5; i++) {
            list1.addFirst(i);
        }
        System.out.println(list1);
        System.out.println(list1.get(2));
        list1.set(2, 999);
        System.out.println(list1);
        System.out.println(list1.size());
        list1.clear();
        System.out.println("-------------------------");
        for(int i = 0; i < 20; i++) {
            list1.add(i % 2, i);
        }
        System.out.println(list1);
        System.out.println(list1);
        list1.reverseDisPlay();
        list1.clear();
        System.out.println("-------------------");
        for(int i = 0; i < 20; i++) {
            list1.add(i%2);
        }
        System.out.println(list1);
        list1.removeAll(0);
        System.out.println(list1);
        list1.clear();
        list1.add(999);
        list1.remove(0);
        System.out.println(list1);
    }

    public TestMyLinkedList(int num) {
        super(num);
    }

    public TestMyLinkedList() {
    }

    @Override
    public String toString() {
        return "TestMyLinkedList: " + super.num;
    }
}
